package com.itheima.demo;

import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) {
        loop : while(true){
            System.out.println("输入数字，0表示退出");
            Scanner sc = new Scanner(System.in);
            String choose = sc.next();
            switch (choose){
                case "1", "2", "3","4","5","6","7","8","9" -> System.out.println(choose);
                case "0" -> {
                    System.out.println("exit");
                    break loop;
                    // 停止虚拟机运行
                    // System.exit(0);
                }
                default -> System.out.println("没有这个选项");
            }
        }

    }
}
